"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_police_alarmRing = require("../../../api/police/alarmRing.js");
require("../../../utils/tools.js");
if (!Array) {
  const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
  const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
  const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
  const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
  (_easycom_up_toast2 + _easycom_up_image2 + _easycom_up_button2 + _easycom_up_popup2)();
}
const _easycom_up_toast = () => "../../../node-modules/uview-plus/components/u-toast/u-toast.js";
const _easycom_up_image = () => "../../../node-modules/uview-plus/components/u-image/u-image.js";
const _easycom_up_button = () => "../../../node-modules/uview-plus/components/u-button/u-button.js";
const _easycom_up_popup = () => "../../../node-modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
  (_easycom_up_toast + _easycom_up_image + _easycom_up_button + _easycom_up_popup)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    const imgyrl = common_vendor.ref("");
    const show = common_vendor.ref(false);
    const open = function(e) {
      if (e == 1) {
        imgyrl.value = "https://mscy.cqlandun.com:8088/static/qr_code_2.jpg";
      } else if (e == 2) {
        imgyrl.value = "https://mscy.cqlandun.com:8088/static/qr_code_1.jpg";
      }
      show.value = true;
    };
    const close = function() {
      show.value = false;
    };
    const uToastRef = common_vendor.ref(null);
    const sloganText = common_vendor.reactive({
      text1: "",
      text2: ""
    });
    const getSlogan = () => {
      common_vendor.index.showLoading({
        title: "加载中",
        mask: true
      });
      api_police_alarmRing.getAlarmRing().then((res) => {
        common_vendor.index.hideLoading();
        const { data } = res;
        sloganText.text1 = data.content.split("；")[0];
        sloganText.text2 = data.content.split("；")[1];
      }).catch((err) => {
        common_vendor.index.hideLoading();
        uToastRef.value.show({
          type: "error",
          message: err
        });
      });
    };
    common_vendor.onLoad(() => {
      common_vendor.index.loadFontFace({
        family: "WeiBeiJian",
        source: 'url("https://mscy.cqlandun.com:8088/static/cyjwb.ttf")',
        success() {
          console.log("success");
        },
        fail(err) {
          console.log(err);
        },
        complete(res) {
          console.log(res);
        }
      });
      getSlogan();
    });
    return (_ctx, _cache) => {
      return {
        a: common_vendor.t(common_vendor.unref(sloganText).text1),
        b: common_vendor.t(common_vendor.unref(sloganText).text2),
        c: common_vendor.o(($event) => open(1)),
        d: common_vendor.o(($event) => open(2)),
        e: common_vendor.sr(uToastRef, "22b4872c-0", {
          "k": "uToastRef"
        }),
        f: common_vendor.p({
          ["show-loading"]: true,
          src: common_vendor.unref(imgyrl),
          width: "360rpx",
          height: "360rpx"
        }),
        g: common_vendor.o(close),
        h: common_vendor.p({
          type: "primary",
          text: "关闭"
        }),
        i: common_vendor.p({
          show: common_vendor.unref(show),
          mode: "center"
        })
      };
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-22b4872c"]]);
wx.createPage(MiniProgramPage);
